<template>
	<view class="">
		<header-top :messageInfo="{typeFlag:true,message:titletext,liner:false}"></header-top>
		<view class="aboutustext">
			<u-parse :content="content"></u-parse>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				content:"",
				type:1,//1使用协议2隐私政策
				titletext:"使用协议"
			}
		},
	
		onLoad(options) {
			this.type = options.type
			if(this.type==2){
				this.titletext = "隐私政策"
			}else if(this.type==3){
				this.titletext = "关于我们"
			}else if(this.type==4){
				this.titletext = "业绩达标详情"
			}else if(this.type==5){
				this.titletext = "预收款活动说明"
			}
			if(this.type==4){
				this.getInfo()
			}else if(this.type==5){
				this.getyhq()
			}else{
				this.init()
			}
			
			
		},
		methods: {
			getInfo() {
				httpRequest.request('/dhtapi/user/index', 'POST', {}).then(res => {
					this.content = res.data.yjdb_des
				}).catch(err => {
					httpRequest.toast(err.msg)
				})
			},
			getyhq() {
				httpRequest.request('/dhtapi/index/getConfigInfo', 'GET', {}).then(res => {
					this.content = res.data.couponjt_des
				}).catch(err => {
					httpRequest.toast(err.msg)
				})
			},
			init() {
				httpRequest.request('/employeesapi/index/getConfigInfo', 'POST', {
				}, false, false, true).then(res => {
					if(this.type==1){
						this.content = res.data.dh_user_xy
					}else if(this.type==2){
						this.content = res.data.dh_user_yszc
					}else if(this.type==3){
						this.content = res.data.about_us
					}
					
				})
			},
		}
	}
</script>

<style scoped>
.aboutustext{
		padding: 30rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #000000;
		text-indent: 60rpx;
	}
</style>
